<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<style>
			.box {
				width: 100px;
				height: 100px;
				background-color: orange;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<div class="box" @click="divClick">
				<button @click.stop="btnClick">按钮</button>
			</div>
		</div>

		<script src="./js/vue.js"></script>
		<script>
			// 1. 创建app实例
			const app = Vue.createApp({
				data() {
					return {
						title: '你好',
					}
				},
				methods: {
					btnClick(e) {
						// e.stopPropagation()
						console.log('click', e)
					},
					divClick() {
						console.log('div click')
					},
				},
			})

			// 2. 挂载到#app上
			app.mount('#app')
		</script>
	</body>
</html>
